Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

Q is empty.

The TRS is overlay and locally confluent. By [15] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)


Using Dependency Pairs [1,13] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

F_3(pair(Y, Z), N, X) → QSORT(Y)
F_3(pair(Y, Z), N, X) → APPEND(qsort(Y), add(X, qsort(Z)))
F_1(pair(X, Z), N, M, Y) → F_2(lt(N, M), N, M, Y, X, Z)
F_1(pair(X, Z), N, M, Y) → LT(N, M)
QSORT(add(N, X)) → F_3(split(N, X), N, X)
LT(s(X), s(Y)) → LT(X, Y)
SPLIT(N, add(M, Y)) → F_1(split(N, Y), N, M, Y)
APPEND(add(N, X), Y) → APPEND(X, Y)
F_3(pair(Y, Z), N, X) → QSORT(Z)
QSORT(add(N, X)) → SPLIT(N, X)
SPLIT(N, add(M, Y)) → SPLIT(N, Y)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ EdgeDeletionProof

Q DP problem:
The TRS P consists of the following rules:

F_3(pair(Y, Z), N, X) → QSORT(Y)
F_3(pair(Y, Z), N, X) → APPEND(qsort(Y), add(X, qsort(Z)))
F_1(pair(X, Z), N, M, Y) → F_2(lt(N, M), N, M, Y, X, Z)
F_1(pair(X, Z), N, M, Y) → LT(N, M)
QSORT(add(N, X)) → F_3(split(N, X), N, X)
LT(s(X), s(Y)) → LT(X, Y)
SPLIT(N, add(M, Y)) → F_1(split(N, Y), N, M, Y)
APPEND(add(N, X), Y) → APPEND(X, Y)
F_3(pair(Y, Z), N, X) → QSORT(Z)
QSORT(add(N, X)) → SPLIT(N, X)
SPLIT(N, add(M, Y)) → SPLIT(N, Y)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
We deleted some edges using various graph approximations

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
QDP
              ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

F_3(pair(Y, Z), N, X) → QSORT(Y)
F_1(pair(X, Z), N, M, Y) → F_2(lt(N, M), N, M, Y, X, Z)
F_3(pair(Y, Z), N, X) → APPEND(qsort(Y), add(X, qsort(Z)))
F_1(pair(X, Z), N, M, Y) → LT(N, M)
QSORT(add(N, X)) → F_3(split(N, X), N, X)
LT(s(X), s(Y)) → LT(X, Y)
APPEND(add(N, X), Y) → APPEND(X, Y)
SPLIT(N, add(M, Y)) → F_1(split(N, Y), N, M, Y)
SPLIT(N, add(M, Y)) → SPLIT(N, Y)
QSORT(add(N, X)) → SPLIT(N, X)
F_3(pair(Y, Z), N, X) → QSORT(Z)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 4 SCCs with 5 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
QDP
                    ↳ QDPOrderProof
                  ↳ QDP
                  ↳ QDP
                  ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APPEND(add(N, X), Y) → APPEND(X, Y)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [13].


The following pairs can be oriented strictly and are deleted.


APPEND(add(N, X), Y) → APPEND(X, Y)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
APPEND(x1, x2)  =  APPEND(x1)
add(x1, x2)  =  add(x1, x2)

Lexicographic Path Order [19].
Precedence:
add2 > APPEND1


The following usable rules [14] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ PisEmptyProof
                  ↳ QDP
                  ↳ QDP
                  ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
QDP
                    ↳ QDPOrderProof
                  ↳ QDP
                  ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

LT(s(X), s(Y)) → LT(X, Y)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [13].


The following pairs can be oriented strictly and are deleted.


LT(s(X), s(Y)) → LT(X, Y)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
LT(x1, x2)  =  LT(x1)
s(x1)  =  s(x1)

Lexicographic Path Order [19].
Precedence:
trivial


The following usable rules [14] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ PisEmptyProof
                  ↳ QDP
                  ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                  ↳ QDP
QDP
                    ↳ QDPOrderProof
                  ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SPLIT(N, add(M, Y)) → SPLIT(N, Y)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [13].


The following pairs can be oriented strictly and are deleted.


SPLIT(N, add(M, Y)) → SPLIT(N, Y)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
SPLIT(x1, x2)  =  SPLIT(x2)
add(x1, x2)  =  add(x2)

Lexicographic Path Order [19].
Precedence:
add1 > SPLIT1


The following usable rules [14] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                  ↳ QDP
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ PisEmptyProof
                  ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                  ↳ QDP
                  ↳ QDP
QDP

Q DP problem:
The TRS P consists of the following rules:

F_3(pair(Y, Z), N, X) → QSORT(Y)
QSORT(add(N, X)) → F_3(split(N, X), N, X)
F_3(pair(Y, Z), N, X) → QSORT(Z)

The TRS R consists of the following rules:

lt(0, s(X)) → true
lt(s(X), 0) → false
lt(s(X), s(Y)) → lt(X, Y)
append(nil, Y) → Y
append(add(N, X), Y) → add(N, append(X, Y))
split(N, nil) → pair(nil, nil)
split(N, add(M, Y)) → f_1(split(N, Y), N, M, Y)
f_1(pair(X, Z), N, M, Y) → f_2(lt(N, M), N, M, Y, X, Z)
f_2(true, N, M, Y, X, Z) → pair(X, add(M, Z))
f_2(false, N, M, Y, X, Z) → pair(add(M, X), Z)
qsort(nil) → nil
qsort(add(N, X)) → f_3(split(N, X), N, X)
f_3(pair(Y, Z), N, X) → append(qsort(Y), add(X, qsort(Z)))

The set Q consists of the following terms:

lt(0, s(x0))
lt(s(x0), 0)
lt(s(x0), s(x1))
append(nil, x0)
append(add(x0, x1), x2)
split(x0, nil)
split(x0, add(x1, x2))
f_1(pair(x0, x1), x2, x3, x4)
f_2(true, x0, x1, x2, x3, x4)
f_2(false, x0, x1, x2, x3, x4)
qsort(nil)
qsort(add(x0, x1))
f_3(pair(x0, x1), x2, x3)

We have to consider all minimal (P,Q,R)-chains.